<include file="Common:header" />
<body>
<table><tr>
<td width="180" valign="top"><include file="Common:adminpanel" /></td>
<td valign="top" >
<div>
<form name="form1" id="form1" method="post" action="<{:U('tplcontentsave')}>">
<table width="100%" cellspacing="1" cellpadding="3" border="0">
			<tr class="header">
				<td height="30" align="right">编辑快递模板：</td>
				<td>(说明：左边边距为空表示不打印)</td>
			</tr>
			<tr class="row">
				<td height="30" align="right">快递模板尺寸：</td>
				<td> 宽：<input name="tplwidth" id="tplwidth" size="6" value="<{$tpl['tplwidth']}>" /> (0.1毫米)  &nbsp;高:<input name="tplheight" id="tplheight" size="6" value="<{$tpl['tplheight']}>" />(0.1毫米)
						偏移量设置： 左偏移<input name="tplleft" id="tplleft" size="6" value="<{$tpl['tplleft']}>" />毫米 
						上偏移<input name="tpltop" id="tpltop" size="6" value="<{$tpl['tpltop']}>" />毫米
				</td>
			</tr>
			<?php
			foreach($tplattrs as $k=>$attr ){
				echo '<tr class="row">
				<td height="30" align="right">'.$attr.'</td>
				<td>距左边边距 <input name="'.$k.'-'.$tplcssname[0].'" type="text" size="10" value="'. $tplcontent[ $k.'-'.$tplcssname[0] ] .'" /> px；
				距顶边边距 <input name="'.$k.'-'.$tplcssname[1].'"  type="text" size="10" value="'. $tplcontent[ $k.'-'.$tplcssname[1] ] .'"/> px；字体大小 
			<input type="text" name="'.$k.'-'.$tplcssname[2].'" id="select" value="'. $tplcontent[ $k.'-'.$tplcssname[2] ] .'" size="10"> PX；  宽度 <input name="'.$k.'-'.$tplcssname[3].'" type="text" size="10" />px</td></tr>';
			}
			?>
			<tr class="row">
				<td height="30" align="right">&nbsp;</td>
				<td>
				<input type="submit" name="button3" id="button3" value="提交" />
				<input type="hidden" name="id" value="<{$tplid}>">
				
				<input type="button" name="button3" id="button3" value="返回列表" onclick="window.location.href='<{:U('templatelist')}>'" />
				</td>
			</tr>
			<tr class="row">
				<td></td>
				<td height="30"   colspan="2">
				<div style="font-family: 微软雅黑,Tahoma; letter-spacing: 2px; display: block;"  id="result"></div>
				</td>
			</tr>
		</table>
		</form>
</div>
</td>
</tr>
</table>	
<script>
// FROM  Submit 

$('#form1').ajaxForm({
    beforeSubmit:  checkForm,  // pre-submit callback
    success:       complete,  // post-submit callback
    dataType: 'json'
});
function checkForm(){
	/*
    if( '' == $.trim($('#title').val())){
        $('#result').html('标题不能为空').show();
        return false;
    }
	*/
    //可以在此添加其它判断
}
function complete(data){
    if (data.status==1){
        $('#result').html(data.info).show().fadeOut(2000);            
    }else{
        $('#result').html(data.info).show();
    }
}
</script>		
</body>
</html>